<?php

class AdvController extends Controller
{
	public function filters()
	{
		return array(
			'accessControl', // perform access control for CRUD operations
		);
	}

	public function accessRules(){
	    return array(
	        array('allow', // allow authenticated users to access all actions
				'users'=>array('@'),
			),
	        array('deny', // deny anything else
	              'users'=>array('*'),
	        ),
	    );
	}

    public function actionIndex()
    {   
		$this -> render('index',array(	

		));
    }

    public function actionSearch()
    {
        if(Yii::app()->request->isPostRequest)
        {            
            $data = Budget::model() -> search();

            echo json_encode(array("results" => $data[0], "total" => $data[1]));
            return;
        }
    }  
}